import {
  createRouter,
  createWebHistory
} from 'vue-router'

const router = createRouter({
  history: createWebHistory(
    import.meta.env.BASE_URL),
  routes: [{
    path: '/home',
    name: '首页',
    component: () => import('../views/index.vue'),
    children: [{
        //生产资源管理
        path: 'personnel',
        name: '人员管理',
        component: () => import('../views/ProductionResources/personnel/PSL_index.vue')
      },
      {
        path: 'equipment',
        name: '设备管理',
        component: () => import('../views/ProductionResources/equipment/EPT_index.vue')
      },
      {
        path: 'material',
        name: '物料管理',
        component: () => import('../views/ProductionResources/material/MTL_index.vue')
      },
      {
        path: 'tray',
        name: '托盘管理',
        component: () => import('../views/ProductionResources/tray/tray_index.vue')
      },
      {
        path: 'terminal',
        name: '终端管理',
        component: () => import('../views/ProductionResources/terminal/terminal_index.vue')
      },
      {
        path: 'station',
        name: '工位管理',
        component: () => import('../views/ProductionResources/station/station_index.vue')
      },
      //产品定义管理
      {
        path: 'productItemNo',
        name: '产品货号管理',
        component: () => import('../views/ProductDefinition/Product/productItemNo.vue'),
        children: [{
          path: 'productAttributes',
          name: '产品属性管理',
          component: () => import('../views/ProductDefinition/Product/ProductAttributes.vue')
        }]
      },

      {
        path: 'productmodel',
        name: '产品型号管理',
        component: () => import('../views/ProductDefinition/ProductModel/PModel_index.vue')
      },
      {
        path: 'processmanagement',
        name: '工序管理',
        component: () => import('../views/ProductDefinition/ProcessManagement/ProcessManagement.vue')
      },
      {
        path: 'checkitems',
        name: '检查项管理',
        component: () => import('../views/QualityManagement/CheckItems/CheckItems.vue')
      },
      //生产调度管理
      {
        path: "order",
        name: "订单管理",
        component: () => import('../views/ProductionScheduing/Order/Order_index.vue')
      },
      {
        path: "order_bom",
        name: "订单bom管理",
        component: () => import('../views/ProductionScheduing/OrderBoom/Order_bom.vue')
      },
      {
        path: "Purchase_order",
        name: "采购订单",
        component: () => import('../views/ProductionScheduing/Order_scheduling/Purchase_order.vue'),
        children: [{
          path: "POrderMaterial",
          name: "采购订单物料入库",
          component: () => import('../views/ProductionScheduing/Order_scheduling/POrder_material.vue'),
        }]
      },
      {
        path: "OrderFirstInspection",
        name: "订单首件管理",
        component: () => import('../views/ProductionScheduing/OrderFirstInspection/OFIindex.vue'),
      },
      //物料管理
      {
        path: "materialbin",
        name: "物料库库位",
        component: () => import('../views/MaterialManagement/MaterialBin/MBin_index.vue'),
        children: [{
          path: "MBinInventory",
          name: "物料库位库存",
          component: () => import('../views/MaterialManagement/MaterialBin/MBinInventory.vue'),
        }]
      },
      {
        path: "finishbin",
        name: "成品库库位",
        component: () => import('../views/MaterialManagement/FinishBin/FBin_index.vue'),
        children: [{
          path: "FBinInventory",
          name: "成品库位库存",
          component: () => import('../views/MaterialManagement/FinishBin/FBinInventory.vue'),
        }]
      },
      {
        path: "MBin_out",
        name: "订单物料出库管理",
        component: () => import('../views/MaterialManagement/MaterialBin/MBin_out.vue')
      },
      {
        path: "MBinInHistory",
        name: "物料入库历史记录",
        component: () => import('../views/MaterialManagement/MaterialBin/MBin_inHistory.vue')
      },
      {
        path: "FBinIn",
        name: "成品入库清单",
        component: () => import('../views/MaterialManagement/FinishBin/FBin_in.vue')
      },
      {
        path: "FBinInHistory",
        name: "成品入库历史记录",
        component: () => import('../views/MaterialManagement/FinishBin/FBin_inHistory.vue')
      },
      //质量管理
      {
        path: "FSHistory",
        name: "首件检查历史记录",
        component: () => import('../views/QualityManagement/FirstInspectHistory/FSHistory_index.vue')
      },
      {
        path: "FQAHistory",
        name: "FQA历史记录",
        component: () => import('../views/QualityManagement/FQAHistory/FQAHistory_index.vue')
      },
      {
        path: "QDHistory",
        name: "质量扣留历史记录",
        component: () => import('../views/QualityManagement/QualityDetainHistory/QDHistory_index.vue')
      },
      //设备管理
      {
        path: "EMTasks",
        name: "设备维护任务",
        component: () => import('../views/EquipmentManagement/EquipmentRepair.vue')
      }
    ]
  }]
})

export default router